package com.chinasi.dao.impl;

import java.util.List;

import org.apache.ibatis.session.RowBounds;

import com.chinasi.dao.BidIntegrationDao;
import com.chinasi.model.BidConsumer;
import com.chinasi.model.BidIntegration;
import com.chinasi.model.ConsumerBasic;
import com.chinasi.model.IntegratorBasic;
import com.chinasi.model.mvo.BidAgencyMvo;
import com.chinasi.model.mvo.BidConsultMvo;
import com.chinasi.model.mvo.BidConsumerMvo;
import com.chinasi.model.mvo.BidExpertMvo;
import com.chinasi.model.mvo.BidIntegrationMvo;
import com.chinasi.model.mvo.BidSupvisionMvo;
import com.caland.framework.core.annotation.Dao;
import com.caland.framework.core.page.Pager;
import com.caland.framework.dao.ibatis.impl.MyBatisBaseDaoImpl;

@Dao
public class BidIntegrationDaoImpl extends MyBatisBaseDaoImpl<BidIntegration, java.lang.String> implements BidIntegrationDao {

	private static final String SQL_PREFIX = "com.chinasi.model.BidIntegration.";
	@Override
	public List<BidIntegrationMvo> findRelationBid(BidIntegration searchBean,
			Pager pager) {
		RowBounds rowBounds = new RowBounds(pager.getStartRow(), pager.getPageSize());
		return this.getCurSqlSessionTemplate().selectList(SQL_PREFIX + "findRelationBid", searchBean, rowBounds);
	}
	@Override
	public int getRelationConsultTotalCount(IntegratorBasic integrator) {
		return this.getCurSqlSessionTemplate().selectOne(SQL_PREFIX + "getRelationConsultTotalCount", integrator);
	}
	@Override
	public List<BidConsultMvo> findRelationConsult(IntegratorBasic integrator,
			Pager pager) {
		RowBounds rowBounds = new RowBounds(pager.getStartRow(), pager.getPageSize());
		return this.getCurSqlSessionTemplate().selectList(SQL_PREFIX + "findRelationConsult", integrator, rowBounds);
	}
	@Override
	public int getRelationConsumerTotalCount(IntegratorBasic integrator) {
		return this.getCurSqlSessionTemplate().selectOne(SQL_PREFIX + "getRelationConsumerTotalCount", integrator);
	}
	@Override
	public List<BidConsumerMvo> findRelationConsumer(
			IntegratorBasic integrator, Pager pager) {
		RowBounds rowBounds = new RowBounds(pager.getStartRow(), pager.getPageSize());
		return this.getCurSqlSessionTemplate().selectList(SQL_PREFIX + "findRelationConsumer", integrator, rowBounds);
	}
	@Override
	public int getRelationAgencyTotalCount(IntegratorBasic integrator) {
		return this.getCurSqlSessionTemplate().selectOne(SQL_PREFIX + "getRelationAgencyTotalCount", integrator);
	}
	@Override
	public List<BidAgencyMvo> findRelationAgency(IntegratorBasic integrator,
			Pager pager) {
		RowBounds rowBounds = new RowBounds(pager.getStartRow(), pager.getPageSize());
		return this.getCurSqlSessionTemplate().selectList(SQL_PREFIX + "findRelationAgency", integrator, rowBounds);
	}
	@Override
	public int getRelationSupervisionTotalCount(IntegratorBasic integrator) {
		return this.getCurSqlSessionTemplate().selectOne(SQL_PREFIX + "getRelationSupervisionTotalCount", integrator);
	}
	@Override
	public List<BidSupvisionMvo> findRelationSupervision(
			IntegratorBasic integrator, Pager pager) {
		RowBounds rowBounds = new RowBounds(pager.getStartRow(), pager.getPageSize());
		return this.getCurSqlSessionTemplate().selectList(SQL_PREFIX + "findRelationSupervision", integrator, rowBounds);
	}
	@Override
	public int getRelationExpertTotalCount(IntegratorBasic integrator) {
		return this.getCurSqlSessionTemplate().selectOne(SQL_PREFIX + "getRelationExpertTotalCount", integrator);
	}
	@Override
	public List<BidExpertMvo> findRelationExpert(IntegratorBasic integrator,
			Pager pager) {
		RowBounds rowBounds = new RowBounds(pager.getStartRow(), pager.getPageSize());
		return this.getCurSqlSessionTemplate().selectList(SQL_PREFIX + "findRelationExpert", integrator, rowBounds);
	}
}
